<template>
  <div id="app">
    <keep-alive :include="['Recommend']">
      <router-view></router-view>
    </keep-alive>
  </div>
</template>
<script>
export default {
  name: 'App',
  data () {
    return {}
  },
  mounted () {
    const self = this
    // 自定义移动端适配方案
    window.onresize = function () {
      self.InitSize()
    }
    self.InitSize()
  },
  methods: {
    InitSize () {
      // 设计图尺寸
      const designWidth = 750
      let deviceWidth =
        window.innerWidth ||
        document.body.clientWidth ||
        document.documentElement.clientWidth
      // 以iphone6屏幕尺寸为标准 ( 1rem = 100px )
      if (deviceWidth >= 640) {
        deviceWidth = 640
      }
      document.getElementsByTagName('html')[0].style.fontSize =
        deviceWidth / (designWidth * 0.01) + 'px'
    }
  }
}
</script>
